home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / tess / tess-1.0 / p2.m < prev    next >
Encoding:
Text File  |  1992-06-30  |  692 b   |  42 lines

  1. #import "p2.h"
  2.  
  3. @implementation p2
  4. - clip: (NXCoord) x: (NXCoord) y 
  5.   if(upx < 0.0)
  6.     PSmoveto(x-upx,y);
  7.   else
  8.     PSmoveto(x,y);
  9.   PSrlineto(overx,0);
  10.   PSrlineto(upx-overx,upy);
  11.   PSclosepath();
  12.   PSclip();
  13.   return self;
  14. }
  15.  
  16. - makeLatticeUnitAt: (NXPoint *) point fromImage: srcimg 
  17. {
  18.   id imgrep;
  19.   NXPoint pt;
  20.   
  21.   pt.x = - point->x ;
  22.   pt.y = - point->y ;
  23.   imgrep = [srcimg bestRepresentation];
  24.   PSgsave();
  25.   [self clip:0.0:0.0];
  26.   [imgrep drawAt: &pt];
  27.   PSgrestore();
  28.   PSgsave();
  29.   PSrotate(180);
  30.   // ??????!!!!!
  31.   if(upx < 0)
  32.     PStranslate(upx,-upy);
  33.   else
  34.     PStranslate(-upx,-upy);
  35.   [self clip:0.0:0.0];
  36.   [imgrep drawAt: &pt];
  37.   PSgrestore();
  38.   return self;
  39. }
  40. @end
  41.